package section10;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class App10_2 {
    public static void main(String[] args) {
        try(FileInputStream fi=new FileInputStream("C:\\Users\\Administrator\\Desktop\\hello.png");
            FileOutputStream fo=new FileOutputStream("C:\\Users\\Administrator\\Desktop\\hello1.png");
            ){
            System.out.println("文件的大小="+fi.available());
            byte[] by=new byte[fi.available()];
            fi.read(by);
            fo.write(by);
            System.out.println("文件已被复制并被更名！");
        }
        catch (IOException ioe){}
    }
}
